package com.liuhuan.sendmessage.service.impl;

import com.cloopen.rest.sdk.CCPRestSmsSDK;
import com.liuhuan.sendmessage.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.UUID;

@Service
public class SmsServiceImpl implements SmsService {
    @Autowired
    private CCPRestSmsSDK smsSdk;
    @Override

    public HashMap<String, Object> sendSms(String to, String templateId, String[] datas, String subAppend) {
        String reqId = UUID.randomUUID().toString().replaceAll("-", "").substring(0, 32);
        return smsSdk.sendTemplateSMS(to, templateId, datas, subAppend, reqId);
    }
}
